package itcz.example.pattern.structure_type.adapter.class_adapter;

/**
 * @ClassName: Client
 * @Author: ITCZ
 * @Date: 2025-04-23
 * @Description: 类适配器模式
 * (缺点:违背合成复用原则,且目标对象必须存在接口，即当前SDCard)
 */
public class Client {
    public static void main(String[] args) {
        Computer computer = new Computer();
        String msg1 = computer.readSD(new SDCardImpl());
        System.out.println(msg1);

        System.out.println("====================");
        // 使用该电脑读取TF卡的数据
        // 定义适配器类
        String msg2 = computer.readSD(new SDAdapterTF());
        System.out.println(msg2);
    }
}
